package com.yanxiuhair.quartz.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.yanxiuhair.common.core.text.Convert;
import com.yanxiuhair.quartz.domain.SysJobLog;
import com.yanxiuhair.quartz.mapper.SysJobLogMapper;
import com.yanxiuhair.quartz.service.ISysJobLogService;

/**
 * @ClassName:  SysJobLogServiceImpl   
 * @Description: 定时任务调度日志信息 服务层  
 * @author: gaoxiaochuang   
 * @date:   2021年7月1日 下午5:00:01   
 *     
 * @Copyright: 2021 http://www.yanxiuhair.com/ Inc. All rights reserved. 
 * 注意：本内容仅限于许昌妍秀发制品有限公司内部传阅，禁止外泄以及用于其他的商业目
 */
@Service
public class SysJobLogServiceImpl implements ISysJobLogService {
	@Autowired
	private SysJobLogMapper jobLogMapper;

	/**
	 * 获取quartz调度器日志的计划任务
	 * 
	 * @param jobLog
	 *            调度日志信息
	 * @return 调度任务日志集合
	 */
	@Override
	public List<SysJobLog> selectJobLogList(SysJobLog jobLog) {
		return jobLogMapper.selectJobLogList(jobLog);
	}

	/**
	 * 通过调度任务日志ID查询调度信息
	 * 
	 * @param jobLogId
	 *            调度任务日志ID
	 * @return 调度任务日志对象信息
	 */
	@Override
	public SysJobLog selectJobLogById(Long jobLogId) {
		return jobLogMapper.selectJobLogById(jobLogId);
	}

	/**
	 * 新增任务日志
	 * 
	 * @param jobLog
	 *            调度日志信息
	 */
	@Override
	public void addJobLog(SysJobLog jobLog) {
		jobLogMapper.insertJobLog(jobLog);
	}

	/**
	 * 批量删除调度日志信息
	 * 
	 * @param ids
	 *            需要删除的数据ID
	 * @return 结果
	 */
	@Override
	public int deleteJobLogByIds(String ids) {
		return jobLogMapper.deleteJobLogByIds(Convert.toStrArray(ids));
	}

	/**
	 * 删除任务日志
	 * 
	 * @param jobId
	 *            调度日志ID
	 */
	@Override
	public int deleteJobLogById(Long jobId) {
		return jobLogMapper.deleteJobLogById(jobId);
	}

	/**
	 * 清空任务日志
	 */
	@Override
	public void cleanJobLog() {
		jobLogMapper.cleanJobLog();
	}
}
